<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const date = new Date()
        let y = date.getMonth()+1
        let r = date.getDate()
        let s = date.getHours()
        let f = date.getMinutes()
        let m = date.getSeconds()

        y = y < 10 ? '0' + y : y
        r = r < 10 ? '0' + r : r
        s = s < 10 ? '0' + s : s
        f = f < 10 ? '0' + f : f
        m = m < 10 ? '0' + m : m


        document.write(`${date.getFullYear()}-${y}-${r}   ${s}:${f}:${m}`)
    </script>
</body>

</html>